package Day6Zuoye;

import java.io.*;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        BufferedReader br=null;
        String i="";
        try {
            InputStreamReader isr=new InputStreamReader(new FileInputStream("C:\\Users\\Administrator\\Desktop\\xinjian\\水浒传.txt"),"GBK");
            br=new BufferedReader(isr);
            System.out.println("输入一个名字:");
            String n=input.next();
           while ((i=br.readLine())!=null){
               if (i.indexOf(n)>0){
                   System.out.println();
               }
           }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
